<include file="Common:header" />
<div class="layui-card layadmin-header"> <span class="layui-breadcrumb" lay-separator="/"> <a href="{:U('Index/welcome')}">首页</a><a href="{:U('Core/add')}">添加菜单</a> </span> </div>
<div class="layui-fluid pt-10 pr-10 pl-20">
<form name="addForm" id="addForm" method="post" action="{:U('Core/save')}" class="layui-form">
	<table class="layui-table">
		<tbody>
			<tr>
				<td>栏目名称</td>
				<td><input type="text" name="lm_name" value="{$data['lm_name']}" class="layui-input" /><input type="hidden" name="id" value="{$data['id']==1?'':$data['id']}" /></td>
				<td>栏 目 ID</td>
				<td><input name="lm_id" type="text" value="{$data['lm_id']}" class="layui-input" /></td>
				<td>排序位置</td>
				<td><input name="sort_no" type="text" value="{$data['sort_no']}" class="layui-input" /></td>
			</tr>
			<tr>
				<td>菜单标题</td>
				<td><input type="text" name="menu_name" value="{$data['menu_name']}" class="layui-input" /></td>
				<td>控制器名</td>
				<td><input type="text" name="action" value="{$data['action']}" class="layui-input" /></td>
				<td>方法名</td>
				<td><input type="text" name="function" value="{$data['function']}" class="layui-input" /></td>
			</tr>
			<tr>
				<td>是否可用</td>
				<td><input type="radio" name="use" value="1" checked="checked" title="是" /><input type="radio" name="use" value="0" <equal name="data['use']" value="0" >checked="checked"</equal> title="否" /> </td>
				<td>创建管理链接</td>
				<td><input type="radio" name="manage" value="1" <equal name="data['manage']" value="1">checked="checked"</equal> title="是" /><input type="radio" name="manage" value="0" <equal name="data['manage']" value="0">checked="checked"</equal> title="否" /></td>
				<td>启用排序</td>
				<td><input type="radio" name="sort" value="1" <equal name="data['sort']" value="1">checked="checked"</equal> title="是" /><input type="radio" name="sort" value="0" <equal name="data['sort']" value="0">checked="checked"</equal> title="否" /></td>
			</tr>
			<tr>
				<td>创建SEO链接</td>
				<td class="textleft"><input type="radio" name="seo" value="1" <equal name="data['seo']" value="1">checked="checked"</equal> title="是" /><input type="radio" name="seo" value="0" <equal name="data['seo']" value="0">checked="checked"</equal> title="否" /></td>
				<td></td>
				<td></td>
				<td>附加选择</td>
				<td><input type="checkbox" name="allow_field[]" value="noadd" title="禁止添加" {:in_array('noadd',$data['allow_field'])?'checked="checked"':''} /> <input type="checkbox" name="allow_field[]" value="nodel" title="禁止删除" {:in_array('nodel',$data['allow_field'])?'checked="checked"':''} /> <input type="checkbox" name="allow_field[]" value="nomod" title="禁止修改" {:in_array('nomod',$data['allow_field'])?'checked="checked"':''} /></td>
			</tr>
		</tbody>
	</table>
	<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
		<legend><font color="#FF0000">请选择文章内容所要显示的字段名称：</font></legend>
	</fieldset>
	<table class="layui-table layui-table-menu">
		<colgroup>
			<col width="100">
			<col width="80">
			<col width="">
			<col width="100">
			<col width="80">
			<col width="">
			<col width="100">
			<col width="80">
			<col width="">
		  <col>
		</colgroup>
		<thead>
			<tr>
				<th>字段名</th>
				<th>启用</th>
				<th>字段实体</th>
				<th>字段名</th>
				<th>启用</th>
				<th>字段实体</th>
				<th>字段名</th>
				<th>启用</th>
				<th>字段实体</th>
			</tr> 
		</thead>
		<tbody>
			<tr>
				<td>title</td>
				<td><input type="checkbox" name="allow_field[]" value="title" lay-skin="primary" {:in_array('title',$data['allow_field'])?'checked="checked"':''} /></td>
				<td><input name="title" type="text" value="{$data['title']}" class="layui-input" /></td>
				<td>category</td>
				<td><input type="checkbox" name="allow_field[]" value="category" lay-skin="primary" {:in_array('category',$data['allow_field'])?'checked="checked"':''} /></td>
				<td><input name="category" type="text" value="{$data['category']}" class="layui-input" /></td>
				<td>content</td>
				<td><input type="checkbox" name="allow_field[]" value="content" lay-skin="primary" {:in_array('content',$data['allow_field'])?'checked="checked"':''} /></td>
				<td><input name="content" type="text" value="{$data['content']}" class="layui-input" /></td>
			</tr>
			
			<tr>
				<td>areaselect</td>
				<td><input name="allow_field[]" type="checkbox" value="areaselect" lay-skin="primary" {:in_array('areaselect',$data['allow_field'])?'checked="checked"':''} /></td>
				<td><input name="areaselect" type="text" value="{$data['areaselect']}" class="layui-input" /></td>
				<td>smallpic</td>
				<td><input type="checkbox" name="allow_field[]" value="smallpic" lay-skin="primary" {:in_array('smallpic',$data['allow_field'])?'checked="checked"':''} /></td>
				<td><input name="smallpic" type="text" value="{$data['smallpic']}" class="layui-input" /></td>
				<td>bigpic</td>
				<td><input name="allow_field[]" type="checkbox" value="bigpic" lay-skin="primary" {:in_array('bigpic',$data['allow_field'])?'checked="checked"':''} /></td>
				<td><input name="bigpic" type="text" value="{$data['bigpic']}" class="layui-input" /></td>
			</tr>
			
			<tr>
				<td>is_tj</td>
				<td><input type="checkbox" name="allow_field[]" value="is_tj" lay-skin="primary" {:in_array('is_tj',$data['allow_field'])?'checked="checked"':''} /></td>
				<td><input name="is_tj" type="text" value="{$data['is_tj']}" class="layui-input" /></td>
				<td>is_gd</td>
				<td><input name="allow_field[]" type="checkbox" value="is_gd" lay-skin="primary" {:in_array('is_gd',$data['allow_field'])?'checked="checked"':''} /></td>
				<td><input name="is_gd" type="text" value="{$data['is_gd']}" class="layui-input" /></td>
				<td></td>
				<td></td>
				<td></td>
			</tr>
			
			<tr>
				<?php
				for($i=1;$i<11;$i++){
				$field = 'title'.$i;
				$field_ = 'title'.$i.'_';
				$field_select = 'title'.$i.'_select';
				$field_check = 'title'.$i.'_check';
				?>
				<td>{$field}</td>
				<td><input type="checkbox" name="allow_field[]" value="{$field}" lay-skin="primary" {:in_array($field,$data['allow_field'])?'checked="checked"':''} /></td>
				<td><input name="{$field}" type="text" value="{$data[$field]}" class="layui-input" /></td>
				<td colspan="3">
					<input name="allow_field[]" type="checkbox" value="{$field}_select" title="select" lay-skin="primary" {:in_array($field.'_select',$data['allow_field'])?'checked="checked"':''} />
					<input name="allow_field[]" type="checkbox" value="{$field}_check" title="check" lay-skin="primary" {:in_array($field.'_check',$data['allow_field'])?'checked="checked"':''} />
					<input name="allow_field[]" type="checkbox" value="{$field}_date" title="date" lay-skin="primary" {:in_array($field.'_date',$data['allow_field'])?'checked="checked"':''} />
					<input name="allow_field[]" type="checkbox" value="{$field}_single" title="single" lay-skin="primary" {:in_array($field.'_single',$data['allow_field'])?'checked="checked"':''} />
					<input name="allow_field[]" type="checkbox" value="{$field}_multi" title="multi" lay-skin="primary" {:in_array($field.'_multi',$data['allow_field'])?'checked="checked"':''} />
				</td>
				<td colspan="3"><input name="{$field}_" type="text" value="{$data[$field_]}" class="layui-input" /></td>
				<?php
				echo'</tr><tr>';
				}
				?>
			</tr>
			<tr>
				<?php
				$fieldlist = array('content1','content2','content3','content4','content5','','name1','name2','name3','name4','name5','','upload1','upload2','upload3','upload4','upload5','multipic');
				foreach($fieldlist as $k => $field){
					if(!$field){
						echo '';
					}else{
				?>
				<td>{$field}</td>
				<td><input name="allow_field[]" type="checkbox" value="{$field}" lay-skin="primary" {:in_array($field,$data['allow_field'])?'checked="checked"':''} /></td>
				<td><input name="{$field}" type="text" value="{$data[$field]}" class="layui-input" /></td>
				<?php
					}
				if(($k+1)%3==0)echo'</tr><tr>';
				}
				?>
			</tr>
			<tr>
				<td>is_ab</td>
				<td><input name="allow_field[]" type="checkbox" value="is_ab" lay-skin="primary" {:in_array('is_ab',$data['allow_field'])?'checked="checked"':''} /></td>
				<td><input name="is_ab" type="text" value="{$data['is_ab']}" class="layui-input" /></td>
				<td>is_cd</td>
				<td><input name="allow_field[]" type="checkbox" value="is_cd" lay-skin="primary" {:in_array('is_cd',$data['allow_field'])?'checked="checked"':''} /></td>
				<td><input name="is_cd" type="text" value="{$data['is_cd']}" class="layui-input" /></td>
				<td>is_ef</td>
				<td><input name="allow_field[]" type="checkbox" value="is_ef" lay-skin="primary" {:in_array('is_ef',$data['allow_field'])?'checked="checked"':''} /></td>
				<td><input name="is_ef" type="text" value="{$data['is_ef']}" class="layui-input" /></td>
			</tr>
			<tr>
				<td>is_gh</td>
				<td><input name="allow_field[]" type="checkbox" value="is_gh" lay-skin="primary" {:in_array('is_gh',$data['allow_field'])?'checked="checked"':''} /></td>
				<td><input name="is_gh" type="text" value="{$data['is_gh']}" class="layui-input" /></td>
				<td>is_jk</td>
				<td><input name="allow_field[]" type="checkbox" value="is_jk" lay-skin="primary" {:in_array('is_jk',$data['allow_field'])?'checked="checked"':''} /></td>
				<td><input name="is_jk" type="text" value="{$data['is_jk']}" class="layui-input" /></td>
				<td>is_mn</td>
				<td><input name="allow_field[]" type="checkbox" value="is_mn" lay-skin="primary" {:in_array('is_mn',$data['allow_field'])?'checked="checked"':''} /></td>
				<td><input name="is_mn" type="text" value="{$data['is_mn']}" class="layui-input" /></td>
			</tr>
			
			<tr>
				<td>hits</td>
				<td><input name="allow_field[]" type="checkbox" value="hits" lay-skin="primary" {:in_array('hits',$data['allow_field'])?'checked="checked"':''} /></td>
				<td><input name="hits" type="text" value="{$data['hits']}" class="layui-input" /></td>
				<td>created</td>
				<td><input name="allow_field[]" type="checkbox" value="created" lay-skin="primary" checked="checked" /></td>
				<td><input name="created" type="text" value="{$data['created'] ? $data['created'] : '创建时间'}" class="layui-input" /></td>
			</tr>
		</tbody>
	</table>
	
	<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
		<legend><font color="#FF0000">请选择类别所要显示的字段名称：</font></legend>
	</fieldset>
	<table class="layui-table layui-table-menu">
		<colgroup>
			<col width="100">
			<col width="80">
			<col width="">
			<col width="100">
			<col width="80">
			<col width="">
			<col width="100">
			<col width="80">
			<col width="">
		  <col>
		</colgroup>
		<thead>
			<tr>
				<th>字段名</th>
				<th>启用</th>
				<th>字段实体</th>
				<th>字段名</th>
				<th>启用</th>
				<th>字段实体</th>
				<th>字段名</th>
				<th>启用</th>
				<th>字段实体</th>
			</tr> 
		</thead>
		<tbody>
			<tr>
				<td>category_title</td>
				<td><input type="checkbox" name="allow_field[]" value="category_title" lay-skin="primary" {:in_array('category_title',$data['allow_field'])?'checked="checked"':''} /></td>
				<td><input name="category_title" type="text" value="{$data['category_title']}" class="layui-input" /></td>
				<td>禁止二级类别</td>
				<td><input name="allow_field[]" type="checkbox" value="no_son" lay-skin="primary" {:in_array('no_son',$data['allow_field'])?'checked="checked"':''} /></td>
				<td>-</td>
				<td>content</td>
				<td colspan="2"><font color="#FF0000">与内容公用一个字段实体。</font></td>
			</tr>
			<tr>
				<?php
				$fieldlist = array('category_title1','category_title2','category_smallpic','category_bigpic','category_bremark','category_name1','category_name2','category_content1','category_content2','category_multipic','','');
				foreach($fieldlist as $k => $field){
					if(!$field){
						echo '';
					}else{
				?>
				<td>{$field}</td>
				<td><input name="allow_field[]" type="checkbox" value="{$field}" lay-skin="primary" {:in_array($field,$data['allow_field'])?'checked="checked"':''} /></td>
				<td><input name="{$field}" type="text" value="{$data[$field]}" class="layui-input" /></td>
				<?php
					}
				if(($k+1)%3==0)echo'</tr><tr>';
				}
				?>
			</tr>
		</tbody>
	</table>
	
	<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
		<legend><font color="#FF0000">请选择留言所要显示的字段名称(title和content字段用文章内容的字段)：</font></legend>
	</fieldset>
	<table class="layui-table layui-table-menu">
		<colgroup>
			<col width="100">
			<col width="80">
			<col width="">
			<col width="100">
			<col width="80">
			<col width="">
			<col width="100">
			<col width="80">
			<col width="">
		  <col>
		</colgroup>
		<thead>
			<tr>
				<th>字段名</th>
				<th>启用</th>
				<th>字段实体</th>
				<th>字段名</th>
				<th>启用</th>
				<th>字段实体</th>
				<th>字段名</th>
				<th>启用</th>
				<th>字段实体</th>
			</tr> 
		</thead>
		<tbody>
			<tr>
				<td>启用回复</td>
				<td><input name="allow_field[]" type="checkbox" value="huifu" lay-skin="primary" {:in_array('huifu',$data['allow_field'])?'checked="checked"':''} /></td>
				<td>-</td>
			</tr>
			<tr>
				<?php
				$fieldlist = array('username','company','phone','tel','fax','pic','email','youbian','addr');
				foreach($fieldlist as $k => $field){
					if(!$field){
						echo '';
					}else{
				?>
				<td>{$field}</td>
				<td><input name="allow_field[]" type="checkbox" value="{$field}" lay-skin="primary" {:in_array($field,$data['allow_field'])?'checked="checked"':''} /></td>
				<td><input name="{$field}" type="text" value="{$data[$field]}" class="layui-input" /></td>
				<?php
					}
				if(($k+1)%3==0)echo'</tr><tr>';
				}
				?>
			</tr>
		</tbody>
	</table>

	<div class="layui-form-item mt-20">
		<div class="layui-input-block">
			<button class="layui-btn" lay-submit lay-filter="formDemo">确认提交</button>
			<button type="reset" class="layui-btn layui-btn-primary" onClick="self.history.back();">返回</button>
		</div>
	</div>
</form>
</div>
<include file="Common:footer" />
<script type="text/javascript">
layui.use(['element','form'], function(){
	//var form = layui.form;
});

/*
$(function(){
	$('.addLink').click(function(){
		$('input[name="doLink"]').val($(this).text());
	})
})*/
</script>